package com.buobao.oa.service;

import com.buobao.oa.dao.NoticeDao;
import com.buobao.oa.entity.Notice;
import com.buobao.oa.utils.MybatisUtils;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import java.util.List;

public class NoticeService {
    public Page<Notice> selectByEmployId(Long employId,int page,int limit) {
        return (Page<Notice>) MybatisUtils.executeUpdate(sqlSession -> {
            PageHelper.startPage(page,limit);
            NoticeDao dao = sqlSession.getMapper(NoticeDao.class);
            Page<Notice> pager = (Page<Notice>) dao.selectByEmployId(employId);
            return pager;
        });
    }
}
